<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>意见反馈的评论</title>
   <link rel="stylesheet" type="text/css" href="__STATIC__/index/css/bootstrap.css"/>
  <link rel="stylesheet" href="__STATIC__/index/css/quan_common.css">
  <link rel="stylesheet" href="__STATIC__/index/css/single.css">
  <link rel="stylesheet" href="__STATIC__/index/css/common.css">
  <link rel="stylesheet" href="__STATIC__/layui/css/layui.css" media="all">
  <script src="__STATIC__/index/js/jquery-3.2.1.js"></script>
  <script src="__STATIC__/layui/layui.js"></script>
</head>
   <script type="text/javascript">
   	//点击回复弹框
   	function active(id){
   		$('#display_blak'+id).removeClass("dis_none");
   	}
   	
   	function Reply(id){
   		var reply = $('#content'+id).val();
   		if(reply==''){
          layui.use('layer', function(){
				  var layer = layui.layer;
				  layer.alert('请填写回复内容', {icon: 2});
					});              
			 		return false;	
   		}
   	  $.ajax({
   	  	type:"post",
   	  	url:"{:url('seller/reply')}",
   	  	data:{id:id,reply:reply},
   	  	success:function(res){
   	  	 if(res.code==1){
   	  	 	$('#val'+id).text(res.msg);
   	  	 	$('#reply'+id).removeClass("dis_none");
   	  	 	$('#display_blak'+id).addClass("dis_none");
   	  	 	$('#content_hide_tab_211328').addClass("dis_none");
   	  	 }else{
   	  	 	 layui.use('layer', function(){
				   var layer = layui.layer;
				   layer.alert(res.msg, {icon: 2});
					 });              
			 		 return false;	
   	  	 }
   	  		
   	  	}
   	  });
   	}
   	
   	//取消回复
   	function quxiao(id){
   		$('#display_blak'+id).addClass("dis_none");
   	}
   	
   </script>
<style>
	.seller_feedback a{
		color: #3286ff;
		background: #eff6ff;
	}
</style>
<body>
	
	 {include file='common/heade'}
  <div class="single_center w_1200">
    {include file='common/left'}
    <div class="single_r_center">
    	
    <div class="single_h3_tab row-s">
      <h3 class="col-6">
          用户反馈
      </h3>
      <div class="col-6 ">
        <!--<div class="tab">
          <div class="col-6"><a href="/tk_zs/feedback.html?type=fankui" class="single-btn btn-default btn-min btn-block l "><span>反馈</span></a>
          </div>
          <div class="col-6"><a href="/tk_zs/feedback.html?type=pinglun" class="single-btn btn-default btn-min btn-block r active"><span>评论</span></a>
          </div>

        </div>-->
      </div>
      <div class="ov_h"></div>
    </div>
    <div class="single_r_center_layout" style="background:#fff;">
      <p class="hr"></p>
      <ul class="single_feedback">
      	{foreach $array as $v}
        <li>
          <a href="#"  class="img">
            <img src="{$v.large_img}" alt="">
          </a>
          <div class="text">
            <p class="name">
              <a href="#"  class="col-link">{$v.title}</a>&nbsp;
              <span class="col-gray">用户</span>
              <span class="col-gray">反馈</span>
            </p>
            <div class="nr">{$v.content}</div>
            <div class="time col-secondary">
              <span>{$v.time|date="Y-m-d H:i:s",###}</span>
              <i>&nbsp;|&nbsp;</i>
              <a href="{$v.web_address}"  class="col-gray com-check com-count" target="_blank">查看</a>
              <i>&nbsp;|&nbsp;</i>
              <a href="{:url('index/Seller/zxGoods',array('ip'=>5,'keywords'=>$v.sp_id))}" class="col-gray com-manage com-count">管理</a>
              {if $v.reply==''}
              <span id="content_hide_tab_211328">
                &nbsp;|&nbsp;
                <a href="#" class="col-gray com-reply com-count active" onclick="active({$v.id})">回复</a>
              </span>
              {/if}
            </div>
            {if $v.reply ==''}
            <div class="feed_list dis_none" id="reply{$v.id}">
              <p>
                <span class="tab">已回复</span> <span id="val{$v.id}">{$v.reply}</span>                
              </p>
            </div>
            {else}
             <div class="feed_list " id="reply{$v.id}">
              <p>
                <span class="tab">已回复</span> <span id="val{$v.id}">{$v.reply}</span>                
              </p>
            </div>
            {/if}
            <div class="form dis_none" id="display_blak{$v.id}">
              <form action="">
                <div class="inputtext">
                  <!--<input type="hidden" name="id">-->
                  <textarea placeholder="在此输入回复内容" name="content" id="content{$v.id}"></textarea>
                </div>
                <div class="form-btn">
                  <!--<input type="submit" value="回复" class="single-btn btn-primary btn-min">-->
                  <a href="#" class="single-btn btn-primary btn-min" onclick="Reply({$v.id})">回复</a>
                  <a href="#" class="single-btn btn-min col-link" onclick="quxiao({$v.id})">取消</a>
                </div>
              </form>
            </div>
          </div>
        </li>
        {/foreach}
      </ul>
      <div align="center" class="table">
           {$array->render()}
			   </div>
			  </div>
      </div>
    </div>
    {include file='common/bottom'}
</body>
<script>

  // var findUl=$(".single_feedback");
  // var lis=findUl.children("li");
  // var liArr=[];
  // for (let i = 0; i < lis.length; i++) {
  //   const element = lis[i];
  //   liArr.push(element)
  // }
  // console.log(liArr)



 /* var aa=$(".active");
  $(".active").click(function(){
    // console.log($(this).parent().parent().parent().children(".feed_list"))
    $(this).parent().parent().parent().children(".feed_list").removeClass("dis_none")
    $(this).parent().parent().parent().children(".form").removeClass("dis_none")
  })
$(".col-link").click(function(){
  console.log($(this).parent().parent().parent())
  $(this).parent().parent().parent().addClass("dis_none")
})*/
</script>
</html>